<?php
class photo_index extends SClass {

    public function process() {
        $photoAlbumId = $this->getArgumentSecure('id');
        if ($photoAlbumId) {
            try {
                $photoAlbum = Triumph::Get()->getMediaService()->getPhotoAlbumById($photoAlbumId);
            } catch (Exception $e) {
                Engine::GetQuery()->setContentNotFound();
            }
        } else {
            $photoAlbum = Triumph::Get()->getMediaService()->getPhotoAlbumAll();
        }
        if ($photoAlbum) {
            $photoAlbum->setHidden(0);
            $a = array();
            while ($x = $photoAlbum->getNext()) {
                $a[] = $x->makeInfoArray(true);
            }
            $this->setValue('photoAlbumArray', $a);
        }

    }

}